import { Typography } from 'antd';
import React, { useEffect, useState } from 'react'

const CartItem = (props) => {
    const { item, onCheckedChange } = props;
    const { name, price, checked } = item;
    const onWrappCheckedChange = (e) => {
        onCheckedChange(item)
    }
    return (
        <div className='item-card'>
            <div className='checkbox-wrap'>
                <input
                    type="checkbox"
                    checked={checked}
                    onChange={onWrappCheckedChange}
                    // onChange={onWrappCheckedChange.bind(null,item)} 
                    name=""
                    id="" />
            </div>
            <div className='item-info'>
                {name}<Typography.Text mark>${price}</Typography.Text>
            </div>
        </div>
    )
}

export default CartItem